package cn.ywang.loadbalance;

import java.util.List;

/**
 * @Auther: BeatificWang
 * @Date: 2018/12/13 23:17
 */
public abstract class AbstractLoadBalance implements LoadBalance {
	@Override
	public String selectServer(List<String> repos) {
		if (repos == null || repos.size() < 1) {
			return null;
		}
		if (repos.size() == 1) {
			return repos.get(0);
		}
		return this.doSelect(repos);
	}

	protected abstract String doSelect(List<String> repos);
}
